<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>人员列表-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
		<meta name="renderer" content="webkit" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
		<link rel="stylesheet" href="../static/css/font.css" />
		<link rel="stylesheet" href="../static/css/weadmin.css" />
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	</head>

	<body>
		<div id="userApp">
			<div class="weadmin-nav" >
				<span class="layui-breadcrumb" style="visibility: visible;">
					<a href="javascript:;">首页</a>
					<span lay-separator="">/</span>
					<a href="userList.html">人员管理</a>
					<span lay-separator="">/</span>
					<a href="userList.html">
						<cite>人员列表</cite>
					</a>
				</span>
			</div>
	
			<div class="weadmin-body" id="userList">
				<div class="layui-row">	
					人员搜索：(第一个时间是时间区间左端点，第二个时间是时间区间右端点，格式如 2022-1-1 22:30:56 采用24小时进制)
					<form class="layui-form layui-col-md12 we-search">
						<div class="layui-inline">
							<input type="text" name="username" placeholder="用户ID" autocomplete="off" class="layui-input" v-model="userId" />
						</div>
						<div class="layui-inline">
							<input type="text" name="username" placeholder="用户名" autocomplete="off" class="layui-input" v-model="userName" />
						</div>
						<div class="layui-inline">
							<input type="text" name="username" placeholder="(yyyy-MM-dd HH:mm:ss)" autocomplete="off" class="layui-input" v-model="createTime" />
						</div>
						<div class="layui-inline">
							<input type="text" name="username" placeholder="(yyyy-MM-dd HH:mm:ss)" autocomplete="off" class="layui-input" v-model="updateTime" />
						</div>
						<div class="layui-inline">
							<input type="text" name="username" placeholder="状态(0封禁,1正常)" autocomplete="off" class="layui-input" v-model="state" />
						</div>
						<div class="layui-inline">
							<input type="text" name="username" placeholder="身份(0普通,1管理员)" autocomplete="off" class="layui-input" v-model="identity" />
						</div>
						<div class="layui-inline">
							<input type="text" name="username" placeholder="性别(0男,1女)" autocomplete="off" class="layui-input" v-model="sex" />
						</div>
						<div class="layui-inline">
							<input type="text" name="username" placeholder="电话" autocomplete="off" class="layui-input" v-model="telephone" />
						</div>
						<div class="layui-inline">
							<input type="text" name="username" placeholder="邮箱" autocomplete="off" class="layui-input" v-model="email" />
						</div>
						<div class="layui-inline">
							<input type="text" name="username" placeholder="地址" autocomplete="off" class="layui-input" v-model="address" />
						</div>
						<button class="layui-btn" type="button" @click="userListClick">
							<i class="layui-icon layui-icon-search"></i>
						</button>
					</form>
				</div>
			
				<table class="layui-table" id="memberList">
					<thead>
						<tr>
							<th>
								<input @click="selectAll()" class="layui-form-checkbox" lay-skin="primary" type="checkbox" />
							</th>
							<th>ID</th>
							<th>用户名</th>
							<th>性别</th>
							<th>手机</th>
							<th>邮箱</th>
							<th>地址</th>
							<th>加入时间</th>
							<th>状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<tr v-for="(item,key) of userList">
							<td>
								<input v-model="ids" :value="item.userId" class="layui-form-checkbox" lay-skin="primary" type="checkbox" />
							</td>
							<td>{{item.userId}}</td>
							<td>{{item.userName}}</td>
							<td>{{item.sex ? "女" : "男"}}</td>
							<td>{{item.telephone}}</td>
							<td>{{item.email}}</td>
							<td>{{item.address}}</td>
							<td>{{item.createTime}}</td>
							<!-- <td>{{item.state}}</td> -->
							<td class="td-status">
								<span class="layui-btn layui-btn-normal layui-btn-xs">已启用</span>
							</td>
							<td class="td-manage">
								<a onclick="member_stop(this,'10001')" href="javascript:;" title="启用">
									<i class="layui-icon layui-icon-download-circle"></i>
								</a>
								<a title="编辑" onclick="WeAdminEdit('编辑','./edit.html', 1, 600, 400)" href="javascript:;">
									<i class="layui-icon layui-icon-edit"></i>
								</a>
								<a onclick="WeAdminShow('修改密码','./password.html',600,400)" title="修改密码" href="javascript:;">
									<i class="layui-icon layui-icon-util"></i>
								</a>
								<a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
									<i class="layui-icon layui-icon-delete"></i>
								</a>
							</td>
						</tr>
					</tbody>
				</table>
				<!-- <div class="page">
					<div>
						<a class="prev" href="">&lt;&lt;</a> <a class="num" href="">1</a>
						<span class="current">2</span> <a class="num" href="">3</a>
						<a class="num" href="">489</a> <a class="next" href="">&gt;&gt;</a>
					</div>
				</div> -->
			</div>

		</div>
	
		
		<!--<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>-->
		<script src="../lib/layui/layui.js" charset="utf-8"></script>
		<script src="../js/request.js"></script>
		<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
		<script type="text/javascript">
			// function callbackUserList(e) {
			// 	console.log(e)
			// }

			var vm=new Vue({
				el:'#userApp',
				data:{
					ids: [],
					userId: "",
					userName: "",
					createTime: "",
					updateTime: "",
					state: "",
					identity: "",
					sex: "",
					telephone: "",
					email: "",
					address: "",
					userList: []
				},
				methods:{
					callbackUserList(e) {
						if (e.flag && e.data != null && e.code == 20000) {
							this.userList = e.data
							console.log(this.userList)
						} else {
							window.alert(e.message)
						}
					},
					userListClick() {
						user = {}

						if (this.userId != "") {
							user["userId"] = this.userId
						}

						if (this.userName != "") {
							user["userName"] = this.userName
						}
						if (this.createTime  != "") {
							user["createTime"] = this.createTime
						}
						if (this.updateTime != "") {
							user["updateTime"] = this.updateTime
						}
						if (this.state != "") {
							user["state"] = this.state
						}
						if (this.identity != "") {
							user["identity"] = this.identity
						}
						if (this.sex != "") {
							user["sex"] = this.sex
						}
						if (this.telephone != "") {
							user["telephone"] = this.telephone
						}
						if (this.email != "") {
							user["email"] = this.email
						}
						if (this.address != "") {
							user["address"] = this.address
						}
						console.log(user)
						// 异步回调
						getUserList(user, this.callbackUserList)
					}
				}
			})
		</script>
	</body>
</html>
